<?php
/**
 * The template for displaying all pages
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site will use a
 * different template.
 *
 * @package WordPress
 * @subpackage maotong
 * @since maotong 1.0
 */

get_header();

// if (stripos($wp->request, 'corp-plan') === 0
// 		&& $_POST) {
// 	$msg = array(
// 		'name' => '',
// 		'email' => '',
// 		'phone' => '',
// 		'company' => '',
// 		'msg' => '',
// 	);
// 	$msg = wp_parse_args($_POST, $msg);
// 	var_dump($msg);die();
// }

$msg = '';
if (isset($_COOKIE['msg_saved'])) {
	$msg_saved = $_COOKIE['msg_saved'];
	if ($msg_saved==='1') {
		$msg = '提交成功，我们会尽快回复您。';
	} elseif ($msg_saved==='0') {
		$msg = '提交失败，请联系管理员解决问题。';
	}
// 	unset($_COOKIE['msg_saved']);//无效
// 	setcookie("msg_saved");//Cannot modify header information - headers already sent by....
//	通过js删除
}
?>

<script>
$(function(){
	$msg = '<?php echo $msg; ?>';
	if ($msg) {
		alert($msg);
		deleteCookie('msg_saved');
	}
});
</script>

<div id="neiye">
	<?php while ( have_posts() ) : the_post(); ?>
		<?php the_content(); ?>
	<?php endwhile; // end of the loop. ?>
</div>

<?php get_footer(); ?>